// pages/start/start.js
const app = getApp();
const mta = require('../../../mta_sdk/mta_analysis.js');
Page({

  data: {
    peopleQuestion: [],
    queryData:{}
  },

  onLoad: function (opt) {
    console.log(opt);
    this.setData({
      queryData:opt
    });
    mta.Page.init();
    this.getpeopleQuestion(opt.test_id);
  },
  getpeopleQuestion(id){
    app.ajax({
      url: "Game/get_people_question",
      loading:true,
      data:{
        category_id:id
      }
    }).then(res => {
      if(res.code==200){
        res.data.forEach((ele,index) => {
          ele.rndNum=(Math.random()*10).toFixed(1);
          if(index==res.data.length-1){
            this.setData({
              peopleQuestion:res.data
            })
          }
        });
      }
    });
  },

})